<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>xin</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="xadsr.html" title="xadsr" />
    <link rel="next" href="xout.html" title="xout" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">xin</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="xadsr.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="xout.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="xin"></a>
      <div class="titlepage"></div>
      <a id="IndexXin" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">xin</span>
        </h2>
        <p>xin — 
      Passes variables to a user-defined opcode block,
    </p>
      </div>
      <div class="refsect1">
        <a id="idp168785984"></a>
        <h2>Description</h2>
        <p>
      The <span class="emphasis"><em>xin</em></span> and <span class="emphasis"><em>xout</em></span> opcodes copy variables to and from the opcode definition, allowing communication with the calling instrument.
    </p>
        <p>
      The types of input and output variables are defined by the parameters <span class="emphasis"><em>intypes</em></span> and <span class="emphasis"><em>outtypes</em></span>.
    </p>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note: Notes">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Notes</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>
        </p>
                <div class="itemizedlist">
                  <ul class="itemizedlist" style="list-style-type: disc; ">
                    <li class="listitem">
                      <p><span class="emphasis"><em>xin</em></span> and <span class="emphasis"><em>xout</em></span> should be called only once, and <span class="emphasis"><em>xin</em></span> should precede <span class="emphasis"><em>xout</em></span>, otherwise an init error and deactivation of the current instrument may occur.</p>
                    </li>
                    <li class="listitem">
                      <p>These opcodes actually run only at i-time. Performance time copying is done by the user opcode call. This means that skipping <span class="emphasis"><em>xin</em></span> or <span class="emphasis"><em>xout</em></span> with <a class="link" href="kgoto.html" title="kgoto"><em class="citetitle">kgoto</em></a> has no effect, while skipping with <a class="link" href="igoto.html" title="igoto"><em class="citetitle">igoto</em></a> affects both init and performance time operation.</p>
                    </li>
                  </ul>
                </div>
                <p>
      </p>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="refsect1">
        <a id="idp168867504"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">xinarg1 [, xinarg2] ... [xinargN] <span class="command"><strong>xin</strong></span></pre>
      </div>
      <div class="refsect1">
        <a id="idp168869536"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>xinarg1</em></span>, <span class="emphasis"><em>xinarg2</em></span>, ... - input arguments. The number and type of variables must agree with the user-defined opcode's <span class="emphasis"><em>intypes</em></span> declaration. However, <span class="emphasis"><em>xin</em></span> does not check for incorrect use of init-time and control-rate variables.
    </p>
        <p>
      The syntax of a user-defined opcode block is as follows:

      </p>
        <pre class="programlisting">
<span class="oblock">opcode</span>  name, outtypes, intypes
xinarg1 [, xinarg2] [, xinarg3] ... [xinargN]  <span class="opc">xin</span>
[<span class="opc">setksmps</span>  iksmps]
... the rest of the instrument's code.
<span class="opc">xout</span>  xoutarg1 [, xoutarg2] [, xoutarg3] ... [xoutargN]
<span class="oblock">endop</span>
      </pre>
        <p>
    </p>
        <p>
      The new opcode can then be used with the usual syntax:

      </p>
        <div class="literallayout">
          <p><br />
[xinarg1] [, xinarg2] ... [xinargN]  name  [xoutarg1] [, xoutarg2] ... [xoutargN] [, iksmps]<br />
      </p>
        </div>
        <p>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp168878752"></a>
        <h2>Examples</h2>
        <p>
      See the example for the <a class="link" href="opcode.html" title="opcode"><em class="citetitle">opcode</em></a> opcode.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp168880944"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="endop.html" title="endop"><em class="citetitle">endop</em></a>, 
      <a class="link" href="opcode.html" title="opcode"><em class="citetitle">opcode</em></a>, 
      <a class="link" href="setksmps.html" title="setksmps"><em class="citetitle">setksmps</em></a>, 
      <a class="link" href="xout.html" title="xout"><em class="citetitle">xout</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp168885936"></a>
        <h2>Credits</h2>
        <p>Author: Istvan Varga, 2002; based on code by Matt J. Ingalls</p>
        <p>New in version 4.22</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="xadsr.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="xout.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">xadsr </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> xout</td>
        </tr>
      </table>
    </div>
  </body>
</html>
